package cn.zxy.dto;

import lombok.Getter;
import lombok.Setter;

public class ResponseDTO {

    @Getter @Setter
    private int code;
    @Getter @Setter
    private String message;
    @Getter @Setter
    private Object data;

    public static ResponseDTO success(Object data){
        ResponseDTO dto = new ResponseDTO();
        dto.setData(data);
        return dto;
    }

    public static ResponseDTO error(int code,String message){
        ResponseDTO dto = new ResponseDTO();
        dto.setCode(code);
        dto.setMessage(message);
        return dto;
    }
}
